<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style type="text/css">

        *{
            margin: 0;padding: 0;
        }
        body{
            font-family: 微软雅黑;font-size: 12px;
        }
        a{
            text-decoration: none;color: #2a75b6;
        }
        li{
            list-style: none;
        }
        #dd{
            width: 658px;height: 417px;overflow: hidden;
            clear: both;
            position:relative;
        }
        #tu{
            width: 1000%;float: left;
            height:100%;
            position:absolute;
            left:0;
            top:0;
        }
        .yun{
            background: url("img/login-all.gif") -453px -469px no-repeat;
            position: absolute;
            left: 28px;
            bottom: -40px;
            height: 100px;
            width: 650px;


        }
        .yun i{
            background: rgba(124, 124, 124, 0.5);
            display: inline-block;
            width: 12px;
            height: 12px;
            border-radius: 50px;
            margin: 0 4px;
            cursor: pointer;
            position: relative;
            left: 450px;

        }

        .yun .item{
            background: rgba(0,0,0,0.5);
            color:white;
        }



    </style>
    <script type="text/javascript" src="js/baidu.js"></script>
</head>
<body>
<div id="beijing">
    <div id="dd">
        <div class="lunbo" id="tu">
            <img src="img/tu1.jpg" alt="" class="lun"/>
            <img src="img/tu2.jpg" alt="" class="lun"/>
            <img src="img/tu3.jpg" alt="" class="lun"/>
            <img src="img/tu4.jpg" alt="" class="lun"/>
        </div>
        <div class="yun" id="yun">
            <i class="item">1</i>
            <i>2</i>
            <i>3</i>
            <i>4</i>
        </div>
    </div>
</div>
</body>
</html>


<!--
<script>
    var dd=document.getElementById('dd');
    console.log(dd);
    var tu =document.getElementById('tu');
    var spans=document.getElementById("yun").getElementsByTagName("i");
    var index=0;
    var Dis = dd.offsetWidth+4;
    function go(){
        var start= tu.offsetLeft;
        var end=index*Dis*(-1);
        console.log(end);
        var change=end-start;
        var maxT=1;
        var t=0;
        var timer;
        clear();

        if(index==spans.length){
            spans[0].className="item";
        }else{
            spans[index].className="item";
        }
        timer=setInterval(function(){
            t++;
            if(t>=maxT){
                clearInterval(timer);
            }
            tu.style.left=change/maxT*t+start+"px";

            if(index==spans.length&&t>=maxT){
                tu.style.left=0;
                index=0;
            }
        },100);
    }
    var time;
    time=setInterval(forward,2000);
    function forward(){
        index++;
        if(index>spans.length){
            index=0;
        }
        go();
    }


    for(var i=0;i<spans.length;i++){
        spans[i].onclick=function(){
            index=this.innerText-1;
            go();
        }
    }
    function clear(){
        for(var i=0;i<spans.length;i++){
            spans[i].className="";
        }
    }


</script>-->
